using UnityEngine;
using System.Collections;

public class CameraFollow : MonoBehaviour {
	
	public Transform target;
	/// <summary>
	/// Axes.Eixos que você pode controlar
	/// </summary>
	public enum Axes { X,Y,Z,XY,XZ,YZ};
	public Axes axes = Axes.X;
	//public 
	
	// Use this for initialization
	void Start () {
		
	
	}
	
	// Update is called once per frame
	void Update () {
		switch(axes)
		{
		case Axes.X:
			this.transform.position = new Vector3(target.transform.position.x,this.transform.position.y,this.transform.position.z);
			break;
		case Axes.Y:
			this.transform.position = new Vector3(this.transform.position.x,target.transform.position.y,this.transform.position.z);
			break;
		case Axes.Z:
			this.transform.position = new Vector3(this.transform.position.x,this.transform.position.y,target.transform.position.z);
			break;
		case Axes.XY:
			this.transform.position = new Vector3(target.transform.position.x,target.transform.position.y,this.transform.position.z);
			break;
			//Seguir em Z é estranho em 2D
		case Axes.XZ:
			this.transform.position = new Vector3(target.transform.position.x,this.transform.position.y,target.transform.position.z);
			break;
			//Seguir em Z é estranho em 2D
		case Axes.YZ:
			this.transform.position = new Vector3(this.transform.position.x,target.transform.position.y,target.transform.position.z);
			break;
		}
		
	
	}
}
